package com.me.launcher.db;

import android.content.Context;
import android.content.SharedPreferences;

/**
 * @author Administrator
 * @date 2016/11/15 0015
 */
public class SharedPreferencesUtil {

    private static final String Screen = "Screen";
    private static final String ScreenW = "ScreenW";
    private static final String ScreenH = "ScreenH";

    /**
     * 保存屏幕宽
     */
    public static void setScreenW(Context mContext, int screenW) {
        SharedPreferences spf = mContext.getSharedPreferences(Screen,
                Context.MODE_PRIVATE);
        SharedPreferences.Editor ed = spf.edit();
        ed.putInt(ScreenW, screenW);
        ed.commit();
    }

    /**
     * 获取屏幕高
     */
    public static int getScreenW(Context mContext) {
        SharedPreferences spf = mContext.getSharedPreferences(Screen,
                Context.MODE_PRIVATE);
        int sta = spf.getInt(ScreenW, -1);
        return sta;
    }


    /**
     * 保存屏幕高
     */
    public static void setScreenH(Context mContext, int screenW) {
        SharedPreferences spf = mContext.getSharedPreferences(Screen,
                Context.MODE_PRIVATE);
        SharedPreferences.Editor ed = spf.edit();
        ed.putInt(ScreenH, screenW);
        ed.commit();
    }

    /**
     * 获取屏幕宽
     */
    public static int getScreenH(Context mContext) {
        SharedPreferences spf = mContext.getSharedPreferences(Screen,
                Context.MODE_PRIVATE);
        int sta = spf.getInt(ScreenH, -1);
        return sta;
    }


}
